<td>
  <ul class="sf_admin_td_actions">
    <li class="sf_admin_action_devolver">
      <?php echo link_to(__('Devolver', array(), 'messages'), 'bb_prestamo/Devolver?id='.$BbPrestamo->getId(), array()) ?>
    </li>
    <li class="sf_admin_action_renovar">
      
    </li>
    
    <li class="sf_admin_action_renovar">
      <?php $error = $BbPrestamo->esAptoParaRenovar();
      if ($error == ''){
        echo link_to(__('Renovar Prestamo', array(), 'messages'), 'bb_prestamo/renovar?id='.$BbPrestamo->getId(), array());
      }else{ ?>
        <script type="text/javascript">
          function showError(){
            var error = '<?php echo $error ?>';
            alert(error);
          }
        </script>
        <a href="#" onclick="showError()">Renovar Prestamo</a>
      <?php } ?>
    </li>
  </ul>
</td>
